/**
 * 
 */
package source.model;

import source.model.type.AreaEffect_InstantDeath_Type;
import source.model.type.AreaEffectType;
import source.view.MainScreen;

public class AreaEffect_InstantDeath extends AreaEffect {
	
	private AreaEffect_InstantDeath_Type AEIDT;

	public AreaEffect_InstantDeath(AreaEffect_InstantDeath_Type AEIDT) {
		super(AreaEffectType.INSTANTDEATH);
		this.AEIDT = AEIDT;
	}

	public boolean doEffect(Unit u) {
		MainScreen.writeToConsole(u.getType() + " instantaneously self destructs");
		u.invalidate();
		return true;
	}
	
	public boolean doEffect(DataHandler dh, Unit u){
		return doEffect(u);
	}

	public java.util.Hashtable<String, String> getViewData()
	{
		java.util.Hashtable<String, String> viewData = super.getViewData();
		
		viewData.put("Area Effect Type", "Instant Death");
		viewData.put("Area Effect Name", AEIDT.getName());
		viewData.put("Area Effect Message", AEIDT.getMsg());
		
		return viewData;
	}

}
